<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>关闭定时器</title>
</head>
<body>
<script>
  setInterval(function () {
    console.log("hello");
  },1000)
  //要关闭定时器的id 不区分定时器种类
  clearInterval(1)
  setTimeout(function () {
    console.log("你好")
  },1000)
  clearTimeout(2);
</script>
</body>
</html>